

//**************************C:\wamp\www\nd/utils/easing/Back.js**************************



function Back() {}

		

Back.easeIn = function ( p_t , p_b, p_c , p_d )
{
	return p_c * ( p_t /= p_d ) * p_t * ( 2.70158 * p_t - 1.70158 ) + p_b;
};

Back.easeOut = function (p_t, p_b, p_c, p_d)
{
	return p_c * ( ( p_t = p_t / p_d - 1) * p_t * ( 2.70158 * p_t + 1.70158) + 1 ) + p_b;
};

Back.easeInOut = function( p_t, p_b, p_c, p_d ) 
{
	if ( ( p_t /= p_d * 0.5 ) < 1 )
	{
		return p_c * 0.5 * ( p_t * p_t * ( ( 1.70158 * 1.525 + 1 ) * p_t - 1.70158 ) ) + p_b;
	}
	else
	{
		return p_c / 2 * ( ( ( p_t -= 2 ) * p_t * ( 1.70158 * 1.525 + 1 ) * p_t + 1.70158 ) + 2 ) + p_b;
	}
	
};



//**************************C:\wamp\www\nd/utils/easing/Bounce.js**************************



function Bounce() {}

Bounce.easeIn = function ( t , b, c , d )
{
	return c - easeOut(d-t, 0, c, d) + b;
};

Bounce.easeOut = function (t, b, c, d)
{
	if ((t/=d) < (1/2.75)) 
	{
		return c*(7.5625*t*t) + b;
	} 
	else if (t < (2/2.75)) 
	{
		return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
	} 
	else if (t < (2.5/2.75)) 
	{
		return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
	} 
	else 
	{
		return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
	}
};

Bounce.easeInOut = function( t, b, c, d ) 
{
	if (t < d*0.5) 
	{
		return Bounce.easeIn (t*2, 0, c, d) * .5 + b;
	}
	else 
	{
		return Bounce.easeOut (t*2-d, 0, c, d) * .5 + c*.5 + b;
	}	
};




//**************************C:\wamp\www\nd/utils/easing/Circ.js**************************



function Circ(){}

	
Circ.easeIn = function(t, b, c, d) 
{
	return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
};

Circ.easeOut = function(t, b, c, d) 
{
	return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
};

Circ.easeInOut = function(t, b, c, d) 
{
	if ((t/=d*0.5) < 1) return -c*0.5 * (Math.sqrt(1 - t*t) - 1) + b;
	return c*0.5 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
};



//**************************C:\wamp\www\nd/utils/easing/Cubic.js**************************


function Cubic() {}
	
Cubic.easeIn = function(t, b, c, d) 
{
	return c*(t/=d)*t*t + b;
};

Cubic.easeOut = function(t, b, c, d) 
{
	return c*((t=t/d-1)*t*t + 1) + b;
};

Cubic.easeInOut = function(t, b, c, d) 
{
	if ((t/=d*0.5) < 1) return c*0.5*t*t*t + b;
	return c*0.5*((t-=2)*t*t + 2) + b;
};



//**************************C:\wamp\www\nd/utils/easing/Elastic.js**************************


function Elastic() {}

Elastic._2PI = Math.PI * 2;
	
Elastic.easeIn = function(t, b, c, d, a, p) 
{

	var s;
	a = a || 0;
	p = p || 0;
	if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
	if (!a || (c > 0 && a < c) || (c < 0 && a < -c)) { a=c; s = p/4; }
	else s = p/Elastic._2PI * Math.asin (c/a);
	return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*Elastic._2PI/p )) + b;
};

Elastic.easeOut  = function(t, b, c, d, a, p ) 
{
	var s;
	a = a || 0;
	p = p || 0;
	if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
	if (!a || (c > 0 && a < c) || (c < 0 && a < -c)) { a=c; s = p/4; }
	else s = p/Elastic._2PI * Math.asin (c/a);
	return (a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*Elastic._2PI/p ) + c + b);
};

Elastic.easeInOut = function (t, b, c, d, a, p) 
{
	var s;
	a = a || 0;
	p = p || 0;
	if (t==0) return b;  if ((t/=d*0.5)==2) return b+c;  if (!p) p=d*(.3*1.5);
	if (!a || (c > 0 && a < c) || (c < 0 && a < -c)) { a=c; s = p/4; }
	else s = p/Elastic._2PI * Math.asin (c/a);
	if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*Elastic._2PI/p )) + b;
	return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*Elastic._2PI/p )*.5 + c + b;
};



//**************************C:\wamp\www\nd/utils/easing/Expo.js**************************

﻿
function Expo (){}

Expo.easeIn = function(t, b, c, d) 
{
	return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b - c * 0.001;
};

Expo.easeOut = function(t, b, c, d) 
{
	return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
};

Expo.easeInOut = function(t, b, c, d) 
{
	if (t==0) return b;
	if (t==d) return b+c;
	if ((t/=d*0.5) < 1) return c*0.5 * Math.pow(2, 10 * (t - 1)) + b;
	return c*0.5 * (-Math.pow(2, -10 * --t) + 2) + b;
};



//**************************C:\wamp\www\nd/utils/easing/Linear.js**************************

/**
 * ...
 * @author HTML5
 */

function Linear() {}

Linear.power = 0;
Linear.easeNone = function(t, b, c, d)
{
	return c*t/d + b;
};

Linear.easeIn = function(t, b, c, d)
{
	return c*t/d + b;
};

Linear.easeOut = function(t, b, c, d)
{
	return c*t/d + b;
};

Linear.easeInOut = function(t, b, c, d)
{
	return c*t/d + b;
};



//**************************C:\wamp\www\nd/utils/easing/Quad.js**************************

function Quad(){}
		
Quad.easeIn = function(t, b, c, d) 
{
	return c*(t/=d)*t + b;
};

Quad.easeOut = function(t, b, c, d) 
{
	return -c *(t/=d)*(t-2) + b;
};

Quad.easeInOut = function( t, b, c, d) 
{
	if ((t/=d*0.5) < 1) return c*0.5*t*t + b;
	return -c*0.5 * ((--t)*(t-2) - 1) + b;
};



//**************************C:\wamp\www\nd/utils/easing/Quart.js**************************


function Quart(){}
	
	
Quart.easeIn = function(t, b, c, d) 
{
	return c*(t/=d)*t*t*t + b;
};

Quart.easeOut = function(t, b, c, d) 
{
	return -c * ((t=t/d-1)*t*t*t - 1) + b;
};

Quart.easeInOut = function(t, b, c, d) 
{
	if ((t/=d*0.5) < 1) return c*0.5*t*t*t*t + b;
	return -c*0.5 * ((t-=2)*t*t*t - 2) + b;
};



//**************************C:\wamp\www\nd/utils/easing/Quint.js**************************


function Quint() {}
	
Quint.easeIn  = function(t, b, c, d) 
{
	return c*(t/=d)*t*t*t*t + b;
};

Quint.easeOut  = function(t, b, c, d) 
{
	return c*((t=t/d-1)*t*t*t*t + 1) + b;
};

Quint.easeInOut  = function(t, b, c, d) 
{
	if ((t/=d*0.5) < 1) return c*0.5*t*t*t*t*t + b;
	return c*0.5*((t-=2)*t*t*t*t + 2) + b;
};



//**************************C:\wamp\www\nd/utils/easing/Sine.js**************************


function Sine(){}

Sine._HALF_PI = Math.PI * 0.5;

Sine.easeIn  = function(t, b, c, d) 
{
	return -c * Math.cos(t/d * _HALF_PI) + c + b;
};

Sine.easeOut  = function(t, b, c, d) 
{
	return c * Math.sin(t/d * _HALF_PI) + b;
};

Sine.easeInOut  = function(t, b, c, d) 
{
	return -c*0.5 * (Math.cos(Math.PI*t/d) - 1) + b;
};



//**************************C:\wamp\www\nd/utils/easing/Strong.js**************************

﻿
function Strong() {}

Strong.easeIn  = function(t, b, c, d) 
{
	return c*(t/=d)*t*t*t*t + b;
};

Strong.easeOut  = function(t, b, c, d) 
{
	return c*((t=t/d-1)*t*t*t*t + 1) + b;
};

Strong.easeInOut  = function(t, b, c, d) 
{
	if ((t/=d*0.5) < 1) return c*0.5*t*t*t*t*t + b;
	return c*0.5*((t-=2)*t*t*t*t + 2) + b;
};



function tweenCompute( p_start, p_end, p_ease, p_numIterations )
{
	var tab = new Array();
	var ratio = 1;
	var diff = p_end - p_start;
	var k = 0;
	
	for( k = 0; k <= p_numIterations; k++ )
	{			
		ratio = p_ease( k, 0, 1, p_numIterations );			
		tab.push( Math.round( p_start + ( ratio * diff ) ) ); 
	}
	
	return tab;
}





